import Image
import sys

try :
	filename = sys.argv[1]
except :
	print sys.argv[0] + ' <image to rotate>'
	
im = Image.open(filename)

im = im.rotate(-90)
im.save(filename[:-4] + '_90.bmp')

im = im.rotate(-90)
im.save(filename[:-4] + '_180.bmp')

im = im.rotate(-90)
im.save(filename[:-4] + '_270.bmp')